<?php
include_once("php/GameLevel.php");
$levels = array();
$imageUrls = array(
	'http://myconstru.w.pw/game/photo1.jpg',
	'http://myconstru.w.pw/game/photo2.jpg',
	'http://myconstru.w.pw/game/photo3.jpg',
	'http://myconstru.w.pw/game/photo4.jpg',
	'http://myconstru.w.pw/game/photo5.jpg',
	'http://myconstru.w.pw/game/photo1.jpg',
	'http://myconstru.w.pw/game/photo2.jpg',
	'http://myconstru.w.pw/game/photo3.jpg',
	'http://myconstru.w.pw/game/photo4.jpg',
	'http://myconstru.w.pw/game/photo5.jpg',
	'http://myconstru.w.pw/game/photo1.jpg',
	'http://myconstru.w.pw/game/photo2.jpg',
	'http://myconstru.w.pw/game/photo3.jpg',
	'http://myconstru.w.pw/game/photo4.jpg',
	'http://myconstru.w.pw/game/photo5.jpg',
	'http://myconstru.w.pw/game/photo1.jpg',
	'http://myconstru.w.pw/game/photo2.jpg',
	'http://myconstru.w.pw/game/photo3.jpg',
	'http://myconstru.w.pw/game/photo4.jpg',
	'http://myconstru.w.pw/game/photo5.jpg');
for ($i=1; $i<500; $i++) { 
	$gameLevel = new GameLevel();
	$gameLevel->level = $i;
	$gameLevel->reward = 3;
	$gameLevel->bonusTimeReward = 1;
	$gameLevel->passLevelPrice = 50;
	$gameLevel->hintPrice = 50;
	$gameLevel->hintTime = 10;
	$gameLevel->loupePrice = 50;
	$gameLevel->loupeTime = 10;
	$gameLevel->failingPrice = 10;
	$gameLevel->targetRectX = 10;
	$gameLevel->targetRectY = 10;
	$gameLevel->targetRectWidth = 100;
	$gameLevel->targetRectHeight = 70;
	$gameLevel->imageUrl = $imageUrls[$i % count($imageUrls)];
	array_push($levels, $gameLevel);
}
$levelIndex = $_GET['levelIndex'];
if (!$levelIndex)
{
	echo "Parameters error: " + json_encode($_GET);
}
elseif ($levelIndex < count($levels))
{
	echo json_encode($levels[$levelIndex]);
}
else
{
	echo "Content error: not enough levels";
}
?>